<?php 
	require_once 'header.php';
	 
	switch ($_GET["MId"]){
		case 0:
		 	$menu_name = "menu-packages-left-sidebar-menu"; 
			$menu_title = "Specials";
			break;
		case 1:
		 	$menu_name = "menu-things-to-do-submenu"; 
			$menu_title = "Things To Do";
			break;
		case 2:
		 	$menu_name = "menu-events-submenu"; 
			$menu_title = "Events";
			break;
		case 3:
		 	$menu_name = "menu-dining-navigation-submenu";  
			$menu_title = "Dining";
			break;
		case 4:
			$menu_name = "menu-weddings-navigation-submenu";
			$menu_title = "Weddings";
			break;
		case 5:
			$menu_name = "menu-membership-left-menu";
			$menu_title = "Meetings and Groups";
			break;
		case 6:
			$menu_name = "menu-shopping-left-menu";
			$menu_title = "Shopping";
			break;
		case 7:
			$menu_name = "menu-membership-left-menu";
			$menu_title = "Support the gardens";
		case 8:
			$menu_name = "menu-membership-left-menu";
			$menu_title = "About Us";
	}
	 
	//get index menu ex Specials, Where to Stay... 
	$content = "";
	
	$query = db_select('menu_links', 'm') 
		  ->condition('m.menu_name', $menu_name)  
		  ->condition('m.hidden', 1, '<>') 
		  ->fields('m', array('link_title', 'menu_name', 'link_path', 'mlid'));
	   
	$result = $query->execute();
	 
	foreach ($result as $record) {
	  	$linkPath = $record->link_path;
		 
	  	$query2 = db_select('menu_router', 'r') 
		  	->condition('r.path', $linkPath);    
		  
		$result2 = $query2->countQuery()->execute()->fetchField();;
		
		//if($result2 > 0){
			$content .= "<li><a href='SubPage.php?SID=".$record->mlid."'>".$record->link_title."</a></li>";
		//}  
	}
	
	//get menu title
	
?>

<body>
<div data-role="page" class="type-home">
	<div data-role="content">
		 
		<div class="content-primary">
			<nav> 

				<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
					<li data-role="list-divider"><?php echo $menu_title; ?></li>
					<?php
						echo $content;
					?>
				</ul>
			</nav>
		</div> 
		
	</div>
 
</div>
</body>
</html>